<%@ page import = "awesome.dbase.DBase" %>
<%@ page import = "java.sql.Statement" %>
<%@ page import = "java.sql.ResultSet" %>
<%@ page import = "java.io.OutputStream" %>

<%
String strSQL = "SELECT regularBlob "
    + "FROM picture "
    + "WHERE (pid= '21')";

	DBase db = new DBase();
	db.openConnection();
	
  Statement stmt = db.getConnection().createStatement();
  
  ResultSet rs = stmt.executeQuery(strSQL);
  rs.next();

  response.setHeader("expires", "0");
  response.setContentType("image/jpeg");

  out.clear();
  OutputStream os = response.getOutputStream();
  os.write(rs.getBytes("regularBlob"));
  out.flush();
 
%>